﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using StripeOne.Core;
using StripeOne.Web.StripeOneServiceReference;

namespace StripeOne.Controllers
{
    public class LoginController : StripeOneController
    {
        public ActionResult Index(string refUrl)
        {
            return View();
        }

        //[HttpGet] //[HttpPost]
        //public ActionResult Index(string username, string password, string refUrl = null)
        //{
        //    //Realiza o login
        //    User result = new StripeOneServiceClient().Login(username, password);

        //    //Cria os cookies
        //    //var user = this.CreateCookies(result);

        //    if (result.IsLoggedIn && result.Status == Status.OK)
        //    {
        //        this.soUser = (User)result;

        //        if (string.IsNullOrEmpty(refUrl))
        //            return RedirectToAction("Index", "Home");
        //        else
        //            return Redirect(refUrl);
        //    }
        //    else
        //    {
        //        ViewBag.ErrorMessage = "Mensagem de erro de login aqui";
        //        return View();
        //    }
        //}

        protected override bool RequireAuthentication { get { return false; } }
    }
}
